<template>
  <view class="photos" :style="Style">
    
		<image :src="datas.src" mode="widthFix" style="width: 100%;"></image>

    
  </view>
</template>

<script>
	
export default {
  name: 'photos',
  props: {
    datas: {type:Object,default:()=>{
		return {
			
		}
	}},
  },
  data(){
	return {
		items:[],
		Style:{}
	}  
  },
  watch:{
	  datas:{
		  handler(newVal,oldVal){
			  //this.set_items();
			  this.datas=newVal;
			  this.set_items(newVal.imageList);
		  },deep:true
	  }
  },
  beforeCreate() {
  	
  },
  created(){
	  this.Style=this.get_style();
	  // if(this.datas.hasOwnProperty("items"))
	  // {
		 //  this.items=this.datas.items;
	  // }
	  this.set_items(this.datas.imageList);
  },
  methods:{
		set_items(d){
			if(d){
				this.items=d;
			
				console.log("photos>set_items>datas",this.items);
			}
		},
	  get_style(){
		  let s=this.datas;
		  s.backgroundColor= this.datas.backColor
		  s.color= this.datas.textColor
		  return this.$comm.getCss( s);
	  }
  }
}
</script>

<style scoped lang="less">
.photos {
  position: relative;
}
</style>
